Imports System
Imports System.Data
Module qs

    Sub Main()

        ' 可以新建连接后直接拷贝过来
        Dim conn = New SqlClient.SqlConnection("Data Source=STAN-MIPRO\SQLEXPRESS;Initial Catalog=test;Integrated Security=True")
        conn.Open()

        Dim cmd = New SqlClient.SqlCommand()
        cmd.CommandText = "select * from man"
        cmd.Connection = conn
        Dim reader = cmd.ExecuteReader()
        While reader.Read
            ' Console.WriteLine(reader.GetString(1))
            Console.WriteLine("id={0},name={1},age={2}",reader.getInt32(0), reader.GetString(1), reader.getInt32(2))
        End While

        reader.Close()
        conn.Close()
        Console.ReadKey()
    End Sub 

End Module
